<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<%@ include file="/WEB-INF/views/include/head.jsp"%> 
<script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
<script src="${ctxStatic}/js/layer.js"></script>
<script src="${ctxStatic}/js/style.js"></script>
<link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
<link rel="stylesheet" href="${ctxStatic}/css/list.css">

<style type="text/css">    
    /* no  */
    .table-no{width: 80px}
    /* 条形码 */
    .table-txm{width: 100px}
    /* 二维码  */
    .table-ewm{width: 100px}
    /* 名称   */
    .table-mc{width: 150px}
    /* 品牌  */
    .table-other1{width: 150px}
    /* 工艺编号  */
    .table-other2{width: 120px}
    /* 工艺值 */
    .table-other3{width: 120px}
    /* 工艺图片 */
    .table-other4{width: 120px}
    /* 说明 */
    .table-other5{width: 120px}
    /* 创建人 */
    .table-cjr{width: 100px}
    /* 创建日期 */
    .table-cjrq{width: 120px}         
</style>

<script type="text/javascript">

//下拉选框带搜索功能
$(document).ready(function() {
	$("#barcodeTypeID").select2();
	$("#printFlag").select2();	
	searchListForm();
});
   
    // 检索方法
	  function searchListForm() {
		var  strList = new Array();
		var flag0 = "<th><p class='table-no'><spring:message code='common_no'/></p></th><th><p class='table-txm'><spring:message code='barcode_code'/></p></th><th><p class='table-ewm'><spring:message code='barcode_qrcode'/></p></th><th><p class='table-mc'><spring:message code='barcode_name'/></p></th><th><p class='table-other1'><spring:message code='barcode_orther1'/></p></th><th><p class='table-other2'><spring:message code='barcode_orther2'/></p></th><th><p class='table-other3'><spring:message code='barcode_orther3'/></p></th><th><p class='table-other4'><spring:message code='barcode_orther4'/></p></th><th><p class='table-other5'><spring:message code='barcode_orther5'/></p></th><th><p class='table-cjr'><spring:message code='dict_creater'/></p></th><th><p class='table-cjrq'><spring:message code='dict_createDate'/></p></th>";
		var flag1 = "<th><p class='table-no'><spring:message code='common_no'/></p></th><th><p class='table-txm'><spring:message code='barcode_code'/></p></th><th><p class='table-ewm'><spring:message code='barcode_qrcode'/></p></th><th><p class='table-mc'><spring:message code='barcode_materialName'/></p></th><th><p class='table-other1'><spring:message code='barcode_materialSpec'/></p></th><th><p class='table-other2'><spring:message code='myWarehouse_Materialcomposition'/></p></th><th><p class='table-other3'><spring:message code='myWarehouse_MaterialColor'/></p></th><th><p class='table-other4'><spring:message code='barcode_supllier'/></p></th><th><p class='table-other5'><spring:message code='barcode_produced'/></p></th><th><p class='table-cjr'><spring:message code='dict_creater'/></p></th><th><p class='table-cjrq'><spring:message code='dict_createDate'/></p></th>";
		var flag2 = "<th><p class='table-no'><spring:message code='common_no'/></p></th><th><p class='table-txm'><spring:message code='barcode_code'/></p></th><th><p class='table-ewm'><spring:message code='barcode_qrcode'/></p></th><th><p class='table-mc'><spring:message code='barcode_name'/></p></th><th><p class='table-other1'><spring:message code='barcode_orther1'/></p></th><th><p class='table-other2'><spring:message code='barcode_orther2'/></p></th><th><p class='table-other3'><spring:message code='barcode_orther3'/></p></th><th><p class='table-other4'><spring:message code='barcode_orther4'/></p></th><th><p class='table-other5'><spring:message code='barcode_orther5'/></p></th><th><p class='table-cjr'><spring:message code='dict_creater'/></p></th><th><p class='table-cjrq'><spring:message code='dict_createDate'/></p></th>";
		var flag3 = "<th><p class='table-no'><spring:message code='common_no'/></p></th><th><p class='table-txm'><spring:message code='barcode_code'/></p></th><th><p class='table-ewm'><spring:message code='barcode_qrcode'/></p></th><th><p class='table-mc'><spring:message code='barcode_name'/></p></th><th><p class='table-other1'><spring:message code='barcode_orther1'/></p></th><th><p class='table-other2'><spring:message code='barcode_orther2'/></p></th><th><p class='table-other3'><spring:message code='barcode_orther3'/></p></th><th><p class='table-other4'><spring:message code='barcode_orther4'/></p></th><th><p class='table-other5'><spring:message code='barcode_orther5'/></p></th><th><p class='table-cjr'><spring:message code='dict_creater'/></p></th><th><p class='table-cjrq'><spring:message code='dict_createDate'/></p></th>";
		var flag4 = "<th><p class='table-no'><spring:message code='common_no'/></p></th><th><p class='table-txm'><spring:message code='barcode_code'/></p></th><th><p class='table-ewm'><spring:message code='barcode_qrcode'/></p></th><th><p class='table-mc'><spring:message code='barcode_name'/></p></th><th><p class='table-other1'><spring:message code='barcode_orther1'/></p></th><th><p class='table-other2'><spring:message code='barcode_orther2'/></p></th><th><p class='table-other3'><spring:message code='barcode_orther3'/></p></th><th><p class='table-other4'><spring:message code='barcode_orther4'/></p></th><th><p class='table-other5'><spring:message code='barcode_orther5'/></p></th><th><p class='table-cjr'><spring:message code='dict_creater'/></p></th><th><p class='table-cjrq'><spring:message code='dict_createDate'/></p></th>";
		var flag5 = "<th><p class='table-no'><spring:message code='common_no'/></p></th><th><p class='table-txm'><spring:message code='barcode_code'/></p></th><th><p class='table-ewm'><spring:message code='barcode_qrcode'/></p></th><th><p class='table-mc'><spring:message code='barcode_orderNo'/></p></th><th><p class='table-other1'><spring:message code='barcode_time'/></p></th><th><p class='table-other2'><spring:message code='barcode_order_state'/></p></th><th><p class='table-other3'><spring:message code='barcode_orther3'/></p></th><th><p class='table-other4'><spring:message code='barcode_materialID'/></p></th><th><p class='table-other5'><spring:message code='barcode_orther5'/></p></th><th><p class='table-cjr'><spring:message code='dict_creater'/></p></th><th><p class='table-cjrq'><spring:message code='dict_createDate'/></p></th>";
		strList[0] = flag0;
		strList[1] = flag1;
		strList[2] = flag2;
		strList[3] = flag3;
		strList[4] = flag4;
		strList[5] = flag5;
		var params = $("#searchForm").serialize();
		$("#activity_pane").showLoading();
		$.post("${ctx}/barcode/management/searchList",params,function(result) {
					var listHtml = result["barcode"];
					var pageHtml = result["page"];
					var flagNum = $("#barcodeTypeID").find("option:selected").val();
					$("#listHtml").html(listHtml);
					$("#paging").html(pageHtml);
					$("#activity_pane").hideLoading();
					if (flagNum!=""&&flagNum!=null) {
						$("#trHtml").html(strList[parseInt(flagNum)]);
					}
					
				}, 'json');
	}   
	
	// 重置方法
	function clearParam(){
		$("#barcodeTypeID").val("");
		$("#barcodeTypeID").select2();
		$("#printFlag").val("");
		$("#printFlag").select2();
		searchListForm();
	}
	
	
	
	
	
  
</script>

</head>
<body>
<form id="searchForm" method="post">
<div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
   			<div class = "searchLeft clearfix">
   			 	<!-- 打印-->
                <div class="searchInp clearfix">
                    <p><spring:message code="barcode_printFlag"/></p>
                    <c:set value="BARCODE_DAYIN" var="barcodeprint"/>
                    <select style="width:130px" id="printFlag" name="printFlag">
                    	<option value=""><spring:message code="material_pleaseChoosed"/></option>
               			<c:forEach items="${fns:getDictList(barcodeprint) }" var="barcodeInfo">
               				<option value="${barcodeInfo.itemValue}">
               					${barcodeInfo.itemName }
               				</option>
               			</c:forEach>
                    </select>
                </div>
                <!-- 区分 -->
                <div class="searchInp clearfix">
                <p><spring:message code="barcode_type"/></p>
                <c:set value="BARCODE_DISTINGUISH" var="barcodelist"/>
              	<select style="width:130px" id="barcodeTypeID" name="barcodeTypeID" data-rule-required="true">
              		 <option value=""><spring:message code="material_pleaseChoosed"/></option>
               			<c:forEach items="${fns:getDictList(barcodelist) }" var="barcodeInfo">
               				<option value="${barcodeInfo.itemValue}">
               					${barcodeInfo.itemName }
               				</option>
               			</c:forEach>
              	</select>
                </div>
   			</div>
            <div class="searchRight clearfix">
                <!-- 检索 -->
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check"/></button>
                <!-- 重置 -->
                <button type="button" onclick="clearParam()"><spring:message code="common_reset"/></button>
            </div>								
         </div>	

	<div class="tableArea">
		<div class="" style="overflow: auto;width: 1293px;padding-top: 36px;height: 714px; ">
			 <table cellpadding="0" class="tableHead">
                    <thead>
                    <tr id="trHtml">                    
                        <th><p class="table-no"><spring:message code=""/></p></th>                       
                        <th><p class="table-txm"><spring:message code=""/></p></th>
                        <th><p class="table-ewm"><spring:message code=""/></p></th>
                        <th><p class="table-mc"><spring:message code=""/></p></th>
                        <th><p class="table-other1"><spring:message code=""/></p></th>
	                    <th><p class="table-other2"><spring:message code=""/></p></th>
	                    <th><p class="table-other3"><spring:message code=""/></p></th>
	                    <th><p class="table-other4"><spring:message code=""/></p></th>
	                    <th><p class="table-other5"><spring:message code=""/></p></th>
                        <th><p class="table-cjr"><spring:message code=""/></p></th>
                        <th><p class="table-cjrq"><spring:message code=""/></p></th>
                    </tr>
                    </thead>
              </table>
              <table cellpadding="0" class="tableBody">
                    <tbody id="listHtml">
                    </tbody>
              </table>	
		</div>
	</div>	
	</div>
	</div>
	<div id = "paging" ></div>
</div>
</form>
</body>
</html>